#include<stdio.h>
int a, b;
void judge(int x, int y)
{
    if(x%y == 0)
		printf("1\n");
	else printf("0\n");
}
int main()
{
	while(scanf("%d%d", &a, &b) != EOF)
	{
		judge(a, b);
	}
	return 0;
}